/****************************************
File name: Student.c
Author: Gu Zhengxiong
Version: 2013.11.22
Description:The file implements functions in STUDENT.
****************************************/

# include <stdio.h>
# include <stdlib.h>

# include "StudentInfo.h"
# include "StudentGrade.h"
# include "Student.h"

void
Display (PSTUDENT ps)
{
	printf ("Name: %s\n", ps->pi->name);
	printf ("Number: %s\n", ps->pi->number);
	printf ("Age: %d\n", ps->pi->age);
	printf ("Maths score: %d\n", ps->pg->maths);//Access violation
	printf ("Clang score: %d\n", ps->pg->clang);
	printf ("English score: %d\n", ps->pg->english);
	/* To be continued.... */
}
void
DestroyPs (PSTUDENT ps_before)
{
	free (ps_before->pnext->pg);
	free (ps_before->pnext->pi);
	ps_before->pnext = ps_before->pnext->pnext;
}